﻿<UserControl
             x:Class="SellAvi.Views.ControlPriceEditor"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d"
             DataContext="{Binding Mailing, Source={StaticResource Locator}}"
             >
    <Grid Margin="10,0,10,10">
        <Grid.RowDefinitions>
            <RowDefinition Height="18" />
            <RowDefinition Height="18" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>


        <Button  Grid.Row="0" Grid.Column="0" Background="WhiteSmoke" Command="{Binding OpenPrepareMailingCommand}" HorizontalContentAlignment="Left" Width="160" Padding="-2,1,-2,1">
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                <Image Width="20" Source="/SellAvi;component/Resources/mail.png"/>
                <TextBlock Width="120" Text="Подготовить рассылку" FontSize="10"/>
                <TextBlock Width="20" Text="{Binding MailingCollection.Count, Mode=OneWay}" FontSize="10" Margin="0" Padding="0" TextAlignment="Center"/>
            </StackPanel>
        </Button>

        <StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal">
            <Button   Background="WhiteSmoke" Command="{Binding SocketOpenCommand}" HorizontalContentAlignment="Left" Width="140" Padding="-2,1,-2,1">
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                    <Image Width="20" Source="/SellAvi;component/Resources/phone.png"/>
                    <TextBlock Width="120" Text="Автоответчик" FontSize="10">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Foreground" Value="Black"/>
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding SocketState}" Value="Open" >
                                        <Setter Property="Foreground" Value="LimeGreen"/>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                </StackPanel>
            </Button>
            <Button  Background="WhiteSmoke" Command="{Binding OpenChatRoomsCommand}" HorizontalContentAlignment="Left" Width="20" Padding="-2,1,-2,1">
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                    <Image Width="20" Source="/SellAvi;component/Resources/equalizer.png"/>
                </StackPanel>
            </Button>
        </StackPanel>






        <!-- при создании 2й копии контрола есть проблема с отображением городов (видимо из-за Static) -->
        <!--<local:ControlRegionCombobox Width="160" Grid.Row="4" ItemsSource="{Binding ServiceProxy.GetRegions}" SelectedRegion="{Binding SelectedRegion, Mode=OneWayToSource}" SelectedCity="{Binding SelectedCity, Mode=OneWayToSource}" />-->



    </Grid>
</UserControl>
